﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLKhachSan.DTO;
using System.Data;
using System.Data.SqlClient;

namespace QLKhachSan.DAO
{
    public class DAO_CTDatTiec
    {
        public static void themCTDatTiec(DTO_CTDatTiec p)
        {
            string[] name = new string[7] {"@MaDatTiec","@TenMon","@ThamMy","@SoLuong","@ThoiGian","@GhiChu","@DonGia" };
            object[] ob = new object[7] { p.MaDatTiec,p.TenMon,p.ThamMy,p.SoLuong,p.ThoiGian,p.GhiChu,p.DonGia };
            clsKetNoi.ThucThiLenhCoTS("pr_ThemCTDatTiec", name, ob, 7);
        }
        public static DataTable hienthiDanhSachCTDatTiec()
        {
            return clsKetNoi.Load("pr_HienThiCTDatTiec");
        }

        public static void xoaCTDatTiec(DTO_CTDatTiec p)
        {
            string[] name = new string[1] { "@MaCTDatTiec" };
            object[] ob = new object[1] { p.MaCTDatTiec };
            clsKetNoi.ThucThiLenhCoTS("pr_XoaCTDatTiec", name, ob, 1);
        }       
        
        public static DataTable hienthiDanhSachCTDatTiecDeThanhToan(DTO_DatTiec p)
        {
            string[] name = new string[2] { "@MaKH","@DaTra" };
            object[] ob = new object[2] { p.MaKH,p.DaTra };
            return clsKetNoi.LoadCoTS("pr_HienThiCTDatTiecDeThanhToan",name,ob,2);
        }        
         public static DataTable hienthiDanhSachCTThongKe()
        {
            return clsKetNoi.Load("pr_HienThiCTDatTiecThongKe");
        }
    }
}
